<?php 

class AdminSpravaKlubuPresenter extends AdminPresenter{
	
	private $model;
	/**
	 * Start lifecycle presenter
	 *
	 * @return void
	 */
	protected function startup(){
		parent::startup();
		$this->model = SpravaKlubuModel::getInstance();
	}

	/**
	 * Settings for all render
	 *
	 * @return void
	 */
	protected function beforeRender(){

	}

	/**
	 * Render default action
	 *
	 * @return void
	 */
	public function renderDefault($id){
		
		$this->template->title = "Správa klubu";
		$this->template->id = $id;
	}
	
	/*protected function createComponentGrid($name){
		
		$grid = new DataGrid;
	    $grid->bindDataTable();
	    
	    $grid->addColumn("title", "Nadpis")->addFilter();
	    $grid->addDateColumn('date', 'Datum', "%d.%m.%Y");
	    //$grid->addColumn("content", "Obsah", 50)->addFilter();
	    $grid->addColumn("perex", "Perex")->addFilter();
	    
	    // nastavíme klíč pro akce (a také i pro operace, o těch později)
		$grid->keyName = 'id_news';
		
		// přidáme sloupec pro akce (sloupců může být i více)
		$grid->addActionColumn('Actions');
		
		// a naplníme datagrid akcemi pomocí továrničky
		$grid->addAction('Nový', 'addNews', Html::el('span')->class('icon icon-edit'), $useAjax = FALSE);
		$grid->addAction('Smaž', 'deleteNews', Html::el('span')->class('icon icon-del'), $useAjax = TRUE);
			    
	    $this->addComponent($grid, "grid");
	}*/
	
	public function actionAddNews($id){

		$this->template->title = "Přidat Novinku";
		$this->template->edit = $this->model->getNewById($_GET["id_news"]);
		$this->template->picture = $this->model->getPicture($this->template->edit["id_file"]);
		$this->template->id_lang = $this->session->admin_id_language;
		$this->template->id = $id;
	}
	
}

?>